
#ifndef __TS_MQTT_H_
#define __TS_MQTT_H_

#include <stdio.h>
#include <stddef.h>
#include <stdbool.h>

void *mqtt_startV4(const char *ip, int port, const char *user, const char *pw,
    void *user_data);
void *mqtt_start(const char *ip, int port, const char *user, const char *pw,
    void *user_data);
void mqtt_stop(void *mqtt);
void *mqtt_init(void *user_data);
//void mqtt_collector_set(void *mqtt);
void *mqtt_set_connect_callback(void *mqtt, void *connect_cal, void *user_data);
void *mqtt_set_message_callback(void *mqtt, void *message_cal, void *user_data);
void *mqtt_set_disconnect_callback(void *mqtt, void *cal, void *user_data);
void mqtt_run(void *mqtt,
    const char *ip, int port, const char *user, const char *pw);
bool mqtt_send(void *mqtt, const char *data, int len, void *user_data);
bool mqtt_subscribe(void *p, const char *topic, void *user_data);
const char *mqtt_message_get_topic(void *p);
const char *mqtt_message_get_payload(void *p);
#endif //__TS_MQTT_H_
